<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>


<!-- 右边内容区域  -->
<section class="content-header">
	<ol class="breadcrumb">
		<li><a href="${basePath }/sys/role"><i class="fa fa-dashboard"></i> 系统设置</a></li>
		<li class="active">数据同步</li>
	</ol>
</section>

<div class="content">
	
	<div style="width:100%;text-align:center">
		<a href="javascript:void(0)" class="btn btn-warning download-info" style="width:120px;margin-top:30px;">下载信息</a>
		<h3>系统首次加载后，请先进行下载信息操作，下载完成后方可进行同步操作</h3>
	</div>
	
	<div style="width:100%;text-align:center">
		<a href="javascript:void(0)" class="btn btn-warning syn-info" style="width:120px;margin-top:30px;">同步信息</a>
		<h3>系统首次加载后，请进行同步信息操作，操作后，系统再次加载不需要再进行同步操作</h3>
	</div>
</div>
<script>
	jQuery("a.syn-info").on('click', function (e) {
		e.stopPropagation();
		var synUrl = basePath + "/sys/synInfo";
		var index = parent.layer.msg('数据同步中...');
		UN_COMMON.ajaxUrl(synUrl, function(json) {
			if (json.success == true) {
				swal("系统提示", json.message, "success");
			} else {
				swal("系统提示", json.message, "error");
			}
			parent.layer.close(index);
		});
	});
	
	jQuery("a.download-info").on('click', function (e) {
		e.stopPropagation();
		var synUrl = basePath + "/sys/downloadInfo";
		var index = parent.layer.msg('数据下载中...');
		UN_COMMON.ajaxUrl(synUrl, function(json) {
			if (json.success == true) {
				swal("系统提示", json.message, "success");
			} else {
				swal("系统提示", json.message, "error");
			}
			parent.layer.close(index);
		});
	});
</script>